{extends 'admin/layout/table-main.tpl'}

{block title}菜单管理{/block}
{block smallTitle}系统内的菜单管理。{/block}
{block head}
	<link href="{asset('admin/css/plugins/chosen/chosen.css')}" rel="stylesheet">
{/block}
{block main}
<div class="row">
	<div class="col-sm-12">
		<div class="ibox float-e-margins">
			<div class="ibox-title">
				<h5>菜单管理 <small>后台菜单编辑/添加</small></h5>
			</div>
			<div class="ibox-content">
				<form method="post" class="form-horizontal" action="{route('AdminMenuEditAction')}">
					{if $data}
					<div class="form-group">
						<label class="col-sm-2 control-label">#</label>
						<div class="col-sm-10">
							<p class="form-control-static">{$data.id}</p>
						</div>
					</div>
					{/if}
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<label class="col-sm-2 control-label">菜单名</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" name="name" value="{Input::old('name', $data.name)|escape}">
						</div>
					</div>
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<label class="col-sm-2 control-label">所属上级</label>
						<div class="col-sm-10">
							<select class="chosen-select" name="pid" style="width:350px;" tabindex="2">
								<option value="">选择上级菜单</option>
								{foreach $parent as $list}
								<option value="{$list.id}" hassubinfo="true" {if $data.pid=== $list.id}selected="selected"{/if}>{$list.option}</option>
								{/foreach}
							</select>
						</div>
					</div>
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<label class="col-sm-2 control-label">路由别名</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" name="route" value="{Input::old('route', $data.route)|escape}">
						</div>
					</div>
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<label class="col-sm-2 control-label">是否有效</label>
						<div class="col-sm-10">
							<select class="" name="status" id='status'>
								<option value="Yes">有效</option>
								<option value="No">无效</option>
							</select>
						</div>
					</div>
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<label class="col-sm-2 control-label">排序</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" name="sort" value="{Input::old('sort', $data.sort)|escape}">
						</div>
					</div>
					<div class="hr-line-dashed"></div>
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<div class="col-sm-4 col-sm-offset-2">
							<input type="hidden" class="form-control" name="id" value="{$data.id}">
							<button class="btn btn-primary" type="submit">保存内容</button>
							<a class="btn btn-white" type="button" href="{route('AdminMenuList')}">返回</a>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
{/block}

{block script}
	<script src="{asset('admin/js/plugins/chosen/chosen.jquery.js')}"></script>
	<script src="{asset('admin/js/demo/form-advanced-demo.min.js')}"></script>
{/block}
